package team.paimengshop.server_socket;

import java.net.Socket;

public class ThreadControl implements Runnable
{
    private Socket socket;
    private SendToClient send;
    private ReceiveFromClient receive;

    public void setSend(SendToClient send)
    {
        this.send = send;
    }

    public SendToClient getSend()
    {
        return send;
    }

    public void setReceive(ReceiveFromClient receive)
    {
        this.receive = receive;
    }

    public ReceiveFromClient getReceive()
    {
        return receive;
    }

    public void setSocket(Socket socket)
    {
        this.socket = socket;
    }

    public Socket getSocket()
    {
        return socket;
    }

    public ThreadControl()
    {

    }

    public ThreadControl(Socket socket)
    {
        this.socket = socket;
        send = new SendToClient(socket);
    }

    @Override
    public void run()
    {
        receive = new ReceiveFromClient(socket, send);
        receive.Receive();
    }
}
